package com.wxy.springAOP;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.ProceedingJoinPoint;

public class Advice {
	public void before(JoinPoint jointPoint) {
		System.out.print("这是前置通知");
		System.out.print("目标类为:"+jointPoint.getTarget());
		System.out.println(",被植入增强的目标方法为"+jointPoint.getSignature().getName());
	}
	public void afterReturning(JoinPoint jointPoint) {
		System.out.print("这是返回通知(方法不出现异常时调用)！");
		System.out.println(",被植入增强的目标方法为"+jointPoint.getSignature().getName());
	}
	public Object around(ProceedingJoinPoint point) throws Throwable {
		System.out.println("环绕通知之前的部分");
		Object object=point.proceed();
		System.out.println("环绕通知之后的部分");
		return object;
	}
	public void after() {
		System.out.println("这是后置通知");
	}
	public void afterException() {
		System.out.println("异常通知");
	}
}
